let str = 'aabbcccddddddddddddeeeee'
function handle(str) {
    let map = new Map()
    let maxVal = 0
    let maxStr = ''
    for(let item of str) {
        map.set(item,(map.get(item) || 0) + 1)
    }

    for(let [key,value] of map) {
        if (value > maxVal) {
            maxVal = value
            maxStr = key
        }
    }

    return [maxStr, maxVal]
}
let res = handle(str)
console.log(res)